/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package research.prototype.transaction;

import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.util.ArrayList;
import java.util.List;
import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRootPane;
import javax.swing.SwingUtilities;
import org.components.containers.CPanel;

/**
 *
 * @author yy
 */
public class PosTicket extends javax.swing.JPanel {

    
    public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {

            @Override
            public void run() {
                JFrame fr=new JFrame();
                Container rp= fr.getContentPane();
                rp.add(new PosTicket());
                fr.setSize(800,800);
                fr.setVisible(true);
                
                        
            }
        });
    }
    
    /**
     * Creates new form PosTicket
     */
    public PosTicket() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        cPanel1 = new org.components.containers.CPanel();
        cButton1 = new org.components.controls.CButton();
        cButton2 = new org.components.controls.CButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        listPanel = new org.components.containers.CPanel();
        listContentPanel = new org.components.containers.CPanel();
        lbl = new javax.swing.JLabel();
        cPanel4 = new org.components.containers.CPanel();
        cPanel5 = new org.components.containers.CPanel();
        cPanel6 = new org.components.containers.CPanel();
        cPanel7 = new org.components.containers.CPanel();
        cPanel11 = new org.components.containers.CPanel();
        cPanel12 = new org.components.containers.CPanel();
        cPanel8 = new org.components.containers.CPanel();
        cPanel9 = new org.components.containers.CPanel();
        cPanel10 = new org.components.containers.CPanel();

        setLayout(null);

        cPanel1.setLayout(null);

        cButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cButton1ActionPerformed(evt);
            }
        });
        cPanel1.add(cButton1);
        cButton1.setBounds(10, 80, 70, 60);

        cButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cButton2ActionPerformed(evt);
            }
        });
        cPanel1.add(cButton2);
        cButton2.setBounds(10, 10, 70, 60);

        add(cPanel1);
        cPanel1.setBounds(10, 11, 90, 420);

        listPanel.setLayout(null);

        listContentPanel.setBackground(new java.awt.Color(0, 255, 102));

        lbl.setText("jLabel1");

        javax.swing.GroupLayout listContentPanelLayout = new javax.swing.GroupLayout(listContentPanel);
        listContentPanel.setLayout(listContentPanelLayout);
        listContentPanelLayout.setHorizontalGroup(
            listContentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(listContentPanelLayout.createSequentialGroup()
                .addGap(93, 93, 93)
                .addComponent(lbl)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        listContentPanelLayout.setVerticalGroup(
            listContentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, listContentPanelLayout.createSequentialGroup()
                .addContainerGap(34, Short.MAX_VALUE)
                .addComponent(lbl)
                .addGap(30, 30, 30))
        );

        listPanel.add(listContentPanel);
        listContentPanel.setBounds(10, 11, 288, 78);

        cPanel4.setBackground(new java.awt.Color(255, 102, 255));

        javax.swing.GroupLayout cPanel4Layout = new javax.swing.GroupLayout(cPanel4);
        cPanel4.setLayout(cPanel4Layout);
        cPanel4Layout.setHorizontalGroup(
            cPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 288, Short.MAX_VALUE)
        );
        cPanel4Layout.setVerticalGroup(
            cPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 84, Short.MAX_VALUE)
        );

        listPanel.add(cPanel4);
        cPanel4.setBounds(10, 95, 288, 84);

        jScrollPane1.setViewportView(listPanel);

        add(jScrollPane1);
        jScrollPane1.setBounds(120, 20, 310, 350);

        cPanel6.setBackground(new java.awt.Color(255, 204, 204));

        javax.swing.GroupLayout cPanel6Layout = new javax.swing.GroupLayout(cPanel6);
        cPanel6.setLayout(cPanel6Layout);
        cPanel6Layout.setHorizontalGroup(
            cPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );
        cPanel6Layout.setVerticalGroup(
            cPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 78, Short.MAX_VALUE)
        );

        cPanel7.setBackground(new java.awt.Color(255, 153, 102));

        javax.swing.GroupLayout cPanel7Layout = new javax.swing.GroupLayout(cPanel7);
        cPanel7.setLayout(cPanel7Layout);
        cPanel7Layout.setHorizontalGroup(
            cPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );
        cPanel7Layout.setVerticalGroup(
            cPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 84, Short.MAX_VALUE)
        );

        cPanel11.setBackground(new java.awt.Color(255, 153, 102));

        javax.swing.GroupLayout cPanel11Layout = new javax.swing.GroupLayout(cPanel11);
        cPanel11.setLayout(cPanel11Layout);
        cPanel11Layout.setHorizontalGroup(
            cPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 90, Short.MAX_VALUE)
        );
        cPanel11Layout.setVerticalGroup(
            cPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 84, Short.MAX_VALUE)
        );

        cPanel12.setBackground(new java.awt.Color(255, 204, 204));

        javax.swing.GroupLayout cPanel12Layout = new javax.swing.GroupLayout(cPanel12);
        cPanel12.setLayout(cPanel12Layout);
        cPanel12Layout.setHorizontalGroup(
            cPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 99, Short.MAX_VALUE)
        );
        cPanel12Layout.setVerticalGroup(
            cPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 78, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout cPanel5Layout = new javax.swing.GroupLayout(cPanel5);
        cPanel5.setLayout(cPanel5Layout);
        cPanel5Layout.setHorizontalGroup(
            cPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(cPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(cPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(cPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(cPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addGroup(cPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(cPanel12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(cPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(13, Short.MAX_VALUE))
        );
        cPanel5Layout.setVerticalGroup(
            cPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(cPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(cPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(cPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(5, 5, 5)
                .addGroup(cPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(cPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(12, Short.MAX_VALUE))
        );

        add(cPanel5);
        cPanel5.setBounds(550, 50, 230, 190);

        cPanel9.setBackground(new java.awt.Color(255, 204, 204));

        javax.swing.GroupLayout cPanel9Layout = new javax.swing.GroupLayout(cPanel9);
        cPanel9.setLayout(cPanel9Layout);
        cPanel9Layout.setHorizontalGroup(
            cPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );
        cPanel9Layout.setVerticalGroup(
            cPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 78, Short.MAX_VALUE)
        );

        cPanel10.setBackground(new java.awt.Color(255, 153, 102));

        javax.swing.GroupLayout cPanel10Layout = new javax.swing.GroupLayout(cPanel10);
        cPanel10.setLayout(cPanel10Layout);
        cPanel10Layout.setHorizontalGroup(
            cPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 50, Short.MAX_VALUE)
        );
        cPanel10Layout.setVerticalGroup(
            cPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 84, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout cPanel8Layout = new javax.swing.GroupLayout(cPanel8);
        cPanel8.setLayout(cPanel8Layout);
        cPanel8Layout.setHorizontalGroup(
            cPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, cPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(cPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(cPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(cPanel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        cPanel8Layout.setVerticalGroup(
            cPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(cPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(cPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(cPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(141, Short.MAX_VALUE))
        );

        add(cPanel8);
        cPanel8.setBounds(440, 20, 70, 320);
    }// </editor-fold>//GEN-END:initComponents

    List<JPanel> panels=new ArrayList();
    private void cButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cButton2ActionPerformed
        
        listPanel.removeAll();
        for (int i = 0; i < 10; i++) {
            CPanel listContentPanel = new CPanel();
            listContentPanel.setBounds(10,  i*80,150,80);
            JLabel lbl= new JLabel();
            lbl.setText(String.valueOf(i));
            listContentPanel.setBorder(BorderFactory.createLineBorder(Color.BLUE));
            listContentPanel.add(lbl);
            listPanel.add(listContentPanel);
            panels.add(listContentPanel);

        }
        listPanel.setPreferredSize(new Dimension(110,10*100));
        listPanel.revalidate();
        listPanel.repaint();
    }//GEN-LAST:event_cButton2ActionPerformed

    private void cButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cButton1ActionPerformed
        //remove panel with 
    }//GEN-LAST:event_cButton1ActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private org.components.controls.CButton cButton1;
    private org.components.controls.CButton cButton2;
    private org.components.containers.CPanel cPanel1;
    private org.components.containers.CPanel cPanel10;
    private org.components.containers.CPanel cPanel11;
    private org.components.containers.CPanel cPanel12;
    private org.components.containers.CPanel cPanel4;
    private org.components.containers.CPanel cPanel5;
    private org.components.containers.CPanel cPanel6;
    private org.components.containers.CPanel cPanel7;
    private org.components.containers.CPanel cPanel8;
    private org.components.containers.CPanel cPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JLabel lbl;
    private org.components.containers.CPanel listContentPanel;
    private org.components.containers.CPanel listPanel;
    // End of variables declaration//GEN-END:variables
}
